<template>
  <div>
    <el-table
      :data="tableData"
      border
      stripe
      style="width: 100%"
      max-height="30%"
    >
      <el-table-column
        prop="rt_id"
        label="工作人员id"
        width="150"
      >
      </el-table-column>
      <el-table-column
        prop="rt_name"
        label="工作人员姓名"
        width="120">
      </el-table-column>
      <el-table-column
        prop="rt_contact"
        label="工作人员联系方式"
        width="150">
      </el-table-column>
      <el-table-column
        prop="rt_role"
        label="工作人员权限"
        width="120">
      </el-table-column>
      <el-table-column
        prop="rt_work"
        label="职责"
        width="120">
      </el-table-column>
      <el-table-column
        label="操作"
        width="100">
        <template slot-scope="scope">
          <el-button v-if="scope.row.rt_role==='负责人'"
                     @click="scope.row.rt_role='普通工作人员'"
                     type="text"
                     size="small"
          >设为普通工作人员</el-button>
          <el-button v-if="scope.row.rt_role==='普通工作人员'"
                     @click="scope.row.rt_role='负责人'"
                     type="text"
                     size="small"
          >设为负责人</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'manageRepairTeam',
  data () {
    return {
      tableData: [
        {
          rt_id: '10001',
          rt_name: '马晓峰',
          rt_contact: '12345678912',
          rt_role: '负责人',
          rt_work: '啥都会'
        },
        {
          rt_id: '10002',
          rt_name: '沈宁',
          rt_contact: '12345678912',
          rt_role: '普通工作人员',
          rt_work: '我是工作内容'
        },
        {
          rt_id: '10003',
          rt_name: '杜雨茜',
          rt_contact: '12345678912',
          rt_role: '普通工作人员',
          rt_work: '我是工作内容'
        },
        {
          rt_id: '10004',
          rt_name: '符蓝天',
          rt_contact: '12345678912',
          rt_role: '普通工作人员',
          rt_work: '我是工作内容'
        },
        {
          rt_id: '10005',
          rt_name: '张坤',
          rt_contact: '12345678912',
          rt_role: '普通工作人员',
          rt_work: '我是工作内容'
        }
      ]
    }
  }
}
</script>

<style scoped>

</style>
